/* Verwandlung Online Judge - A cross-platform judge online system
 * Copyright (C) 2018 Haozhe Xie <cshzxie@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 *                              _ooOoo_  
 *                             o8888888o  
 *                             88" . "88  
 *                             (| -_- |)  
 *                             O\  =  /O  
 *                          ____/`---'\____  
 *                        .'  \\|     |//  `.  
 *                       /  \\|||  :  |||//  \  
 *                      /  _||||| -:- |||||-  \  
 *                      |   | \\\  -  /// |   |  
 *                      | \_|  ''\---/''  |   |  
 *                      \  .-\__  `-`  ___/-. /  
 *                    ___`. .'  /--.--\  `. . __  
 *                 ."" '<  `.___\_<|>_/___.'  >'"".  
 *                | | :  `- \`.;`\ _ /`;.`/ - ` : | |  
 *                \  \ `-.   \_ __\ /__ _/   .-` /  /  
 *           ======`-.____`-.___\_____/___.-`____.-'======  
 *                              `=---=' 
 *
 *                          HERE BE BUDDHA
 *
 */
package com.example.demo.domain.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.example.demo.dto.VojProblemLanguageDto;

import java.io.Serializable;
import java.util.List;

/**
 * 试题的Model.
 * 对应数据库中的voj_problems数据表.
 *
 */
public class TrainingProblem implements Serializable {
	/**
	 * Problem的默认构造函数.
	 */
	public TrainingProblem() {}

	/**
	 * 试题的唯一标识符.
	 */
	@TableId(type = IdType.AUTO)
	private long problemId;

	/**
	 * 试题是否公开.
	 */
	private boolean isPublic;

	/**
	 * 试题名称.
	 */
	private String problemName;

	/**
	 * 试题包含的标签.
	 */
	private String problemTags;

	public String getProblemTags() {
		return problemTags;
	}

	public void setProblemTags(String problemTags) {
		this.problemTags = problemTags;
	}

	public void setInputFormat(String inputFormat) {
		this.problemInputFormat = inputFormat;
	}

	/**
	 * 试题的总提交总数.
	 */
	private long totalSubmission;

	/**
	 * 试题的提交通过总数.
	 */
	private long acceptedSubmission;

	/**
	 * 最大运行时间.
	 */
	
	private int timeLimit;

	/**
	 * 最大运行内存.
	 */
	
	private int memoryLimit;

	/**
	 * 试题描述.
	 */
	
	private String problemDescription;

	/**
	 * 输入格式.
	 */
	
	private String problemInputFormat;

	/**
	 * 输出格式.
	 */
	
	private String problemOutputFormat;

	/**
	 * 样例输入.
	 */
	
	private String problemSampleInput;

	/**
	 * 样例输出.
	 */
	
	private String problemSampleOutput;

	/**
	 * 试题提示.
	 */
	
	private String problemHint;

	/**
	 * 所属公司
	 */
	private Long companyId;
	private String companyName;

	/**
	 * 分类
	 */
	private String category;
	/**
	 * 测试用例
	 */
	private List<VojProblemCheckpoints> testcase;

	/**
	 * 语言-时间空间限制
	 */
	private List<VojProblemLanguageDto> languageList;

	public List<VojProblemCheckpoints> getTestcase() {
		return testcase;
	}

	public void setTestcase(List<VojProblemCheckpoints> testcase) {
		this.testcase = testcase;
	}

	public List<VojProblemLanguageDto> getLanguageList() {
		return languageList;
	}

	public void setLanguageList(List<VojProblemLanguageDto> languageList) {
		this.languageList = languageList;
	}

	public String getProblemDescription() {
		return problemDescription;
	}

	public void setProblemDescription(String problemDescription) {
		this.problemDescription = problemDescription;
	}

	public String getProblemInputFormat() {
		return problemInputFormat;
	}

	public void setProblemInputFormat(String problemInputFormat) {
		this.problemInputFormat = problemInputFormat;
	}

	public String getProblemOutputFormat() {
		return problemOutputFormat;
	}

	public void setProblemOutputFormat(String problemOutputFormat) {
		this.problemOutputFormat = problemOutputFormat;
	}

	public String getProblemSampleInput() {
		return problemSampleInput;
	}

	public void setProblemSampleInput(String problemSampleInput) {
		this.problemSampleInput = problemSampleInput;
	}

	public String getProblemSampleOutput() {
		return problemSampleOutput;
	}

	public void setProblemSampleOutput(String problemSampleOutput) {
		this.problemSampleOutput = problemSampleOutput;
	}

	public String getProblemHint() {
		return problemHint;
	}

	public void setProblemHint(String problemHint) {
		this.problemHint = problemHint;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public Long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	/**
	 * Problem的构造函数.
	 * @param isPublic - 试题是否公开
	 * @param problemName - 试题的名称
	 * @param timeLimit - 最大运行时间
	 * @param memoryLimit - 最大运行内存
	 * @param problemDescription - 试题描述
	 * @param inputFormat - 试题输入格式描述
	 * @param outputFormat - 试题输出描述
	 * @param sampleInput - 试题样例输入
	 * @param sampleOutput - 试题样例输出
	 * @param hint - 试题提示
	 */
	public TrainingProblem(boolean isPublic, String problemName, int timeLimit, int memoryLimit,
                           String problemDescription, String inputFormat, String outputFormat,
                           String sampleInput, String sampleOutput, String hint) {
		this.isPublic = isPublic;
		this.problemName = problemName;
		this.timeLimit = timeLimit;
		this.memoryLimit = memoryLimit;
		this.problemDescription = problemDescription;
		this.problemInputFormat = inputFormat;
		this.problemOutputFormat = outputFormat;
		this.problemSampleInput = sampleInput;
		this.problemSampleOutput = sampleOutput;
		this.problemHint = hint;
	}

	/**
	 * Problem类的构造函数.
	 * @param problemId - 试题唯一标识符
	 * @param isPublic - 试题是否公开
	 * @param problemName - 试题的名称
	 * @param timeLimit - 最大运行时间
	 * @param memoryLimit - 最大运行内存
	 * @param description - 试题描述
	 * @param inputFormat - 试题输入描述
	 * @param outputFormat - 试题输出描述
	 * @param sampleInput - 试题样例输入
	 * @param sampleOutput - 试题样例输出
	 * @param hint - 试题提示
	 */
	public TrainingProblem(long problemId, boolean isPublic, String problemName, int timeLimit,
                           int memoryLimit, String description, String inputFormat, String outputFormat,
                           String sampleInput, String sampleOutput, String hint) {
		this(isPublic, problemName, timeLimit, memoryLimit, description, inputFormat, outputFormat, sampleInput, sampleOutput, hint);
		this.problemId = problemId;
	}
	
	/**
	 * 获取试题唯一标识符.
	 * @return 试题唯一标识符
	 */
	public long getProblemId() {
		return problemId;
	}

	/**
	 * 设置试题唯一标识符.
	 * @param problemId - 试题唯一标识符
	 */
	public void setProblemId(long problemId) {
		this.problemId = problemId;
	}
	
	/**
	 * 获取试题是否公开的.
	 * @return 试题是否公开
	 */
	public boolean isPublic() {
		return isPublic;
	}

	/**
	 * 设置试题是否公开.
	 * @param isPublic - 试题是否公开
	 */
	public void setPublic(boolean isPublic) {
		this.isPublic = isPublic;
	}

	/**
	 * 获取试题名称.
	 * @return 试题名称
	 */
	public String getProblemName() {
		return problemName;
	}

	/**
	 * 设置试题名称.
	 * @param problemName - 试题名称
	 */
	public void setProblemName(String problemName) {
		this.problemName = problemName;
	}


	/**
	 * 获取试题提交总数.
	 * @return 试题提交总数
	 */
	public long getTotalSubmission() {
		return totalSubmission;
	}

	/**
	 * 设置试题提交总数.
	 * @param totalSubmission - 试题提交总数
	 */
	public void setTotalSubmission(long totalSubmission) {
		this.totalSubmission = totalSubmission;
	}

	/**
	 * 获取试题提交通过总数.
	 * @return 试题提交通过总数
	 */
	public long getAcceptedSubmission() {
		return acceptedSubmission;
	}

	/**
	 * 设置试题提交通过总数
	 * @param acceptedSubmission - 试题提交通过总数
	 */
	public void setAcceptedSubmission(long acceptedSubmission) {
		this.acceptedSubmission = acceptedSubmission;
	}

	/**
	 * 获取最大运行时间.
	 * @return 最大运行时间
	 */
	public int getTimeLimit() {
		return timeLimit;
	}

	/**
	 * 设置最大运行时间.
	 * @param timeLimit - 最大运行时间
	 */
	public void setTimeLimit(int timeLimit) {
		this.timeLimit = timeLimit;
	}

	/**
	 * 获取最大运行内存.
	 * @return 最大运行内存
	 */
	public int getMemoryLimit() {
		return memoryLimit;
	}

	/**
	 * 设置最大运行内存.
	 * @param memoryLimit
	 */
	public void setMemoryLimit(int memoryLimit) {
		this.memoryLimit = memoryLimit;
	}
	
	/**
	 * 获取试题描述.
	 * @return 试题描述
	 */
	public String getDescription() {
		return problemDescription;
	}

	/**
	 * 设置试题描述.
	 * @param description - 试题描述
	 */
	public void setDescription(String description) {
		this.problemDescription = description;
	}

	/**
	 * 获取输入格式描述.
	 * @return 输入格式描述
	 */
	public String getInputFormat() {
		return problemInputFormat;
	}

	/**
	 * 设置输入格式描述.
	 * @param inputFormat - 输入格式描述
	 */
	public void setInpuFormatt(String inputFormat) {
		this.problemInputFormat = inputFormat;
	}

	/**
	 * 获取输出格式描述.
	 * @return 输出格式描述
	 */
	public String getOutputFormat() {
		return problemOutputFormat;
	}

	/**
	 * 设置输出格式描述.
	 * @param outputFormat - 输出格式描述
	 */
	public void setOutputFormat(String outputFormat) {
		this.problemOutputFormat = outputFormat;
	}

	/**
	 * 获取样例输入.
	 * @return 样例输入
	 */
	public String getSampleInput() {
		return problemSampleInput;
	}

	/**
	 * 设置样例输入.
	 * @param sampleInput - 样例输入
	 */
	public void setSampleInput(String sampleInput) {
		this.problemSampleInput = sampleInput;
	}

	/**
	 * 获取样例输出.
	 * @return 样例输出
	 */
	public String getSampleOutput() {
		return problemSampleOutput;
	}

	/**
	 * 设置样例输出.
	 * @param sampleOutput - 样例输出
	 */
	public void setSampleOutput(String sampleOutput) {
		this.problemSampleOutput = sampleOutput;
	}

	/**
	 * 获取试题提示.
	 * @return 试题提示
	 */
	public String getHint() {
		return problemHint;
	}

	/**
	 * 设置试题提示.
	 * @param hint - 试题提示
	 */
	public void setHint(String hint) {
		this.problemHint= hint;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return String.format("TrainingProblem: [ProblemID=%s, isPublic=%s, ProblemName=%s, TotalSubmission=%s, "
							+ "AcceptedSubmission=%s, TimeLimit=%s, MemoryLimit=%s, ProblemDescription=%s, "
							+ "InputFormat=%s, OutputFormat=%s, SampleInput=%s, SampleOutput=%s, Hint=%s]", 
				new Object[] { problemId, isPublic, problemName, totalSubmission, acceptedSubmission,
								timeLimit, memoryLimit, problemDescription, problemInputFormat, problemOutputFormat, problemSampleInput,
								problemSampleOutput, problemHint});
	}

	
	/**
	 * 唯一的序列化标识符.
	 */
	private static final long serialVersionUID = 4703482016721365341L;
}
